package cn.edu.scau.cmi.dengzejun.chapter09;

import java.util.*;
import java.util.regex.*;

public class Example9_19 {
	public static void main(String args[]) {
		Pattern p;
		Matcher m;
		String regex = "(www)[-a-zA-Z0-9+~!@#$%^&;',.]*[-a-zA-Z0-9+!@#$%^&~';,.]";
		p = Pattern.compile(regex);
		String s = "the Tsinghua University's website is : wwww.tsinghua.edu.cn ";
		m = p.matcher(s);
		while (m.find()) {
			String str = m.group();
			System.out.println(str);
		}
		System.out.println("delete the website from the string ");
		String result = m.replaceAll("");
		System.out.println(result);
		return;
	}
}
